<?php
session_start();
if (isset($_GET['c'])){
    /**
	if ('cao' == $_GET['c']){
		if (isset($_SESSION['openid'])){
			$openid=$_SESSION['openid'];
		}else{
			$_SESSION['openid']='cao'.date("md").rand(1,999999).rand(2,999999);
			$openid=$_SESSION['openid'];
		}
		include_once './c/config.php';
		$mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
		$sql="select id from users where openid='".$openid."'  limit 0,1 ";
		$query = $mysqli->query($sql);
		if($query->num_rows>0){
		}else{
			$sql = "insert into users(openid,createtime) values ('".$openid."','".date("Y-m-d H:i:s")."' )";
			$mysqli->query($sql);
		}
		header('Location: https://mei94.com/hisense/home.php?c=cao');
		$mysqli->close();
		exit;
	}  */
}

header("Content-Type:text/html;charset=UTF-8");
include_once './c/config.php';
$redirect_uri = urlencode('https://mei94.com/hisense/base.php');
$api_userinfo_base='https://open.weixin.qq.com/connect/oauth2/authorize?appid='.$appId.'&redirect_uri='.$redirect_uri.'&response_type=code&scope=snsapi_base#wechat_redirect';

header('Location: '.$api_userinfo_base);